import store from "@/store/index";

import { DispatchOptions } from 'vuex'

/**
 * 获取状态属性
 * @param key
 * @returns
 */
export function useGetters(key: string){
  return store.getters[key];
}

/**
 * 执行状态方法
 * @param key
 * @param payload
 * @param options
 * @returns
 */
export function useDispatch(key: string, payload: any = {}, options: DispatchOptions = {}){
  return store.dispatch(key, payload, options)
}

